<?php
		include("dbconn.inc");
		include("dbfuc.inc");
		include("session.inc");		
		$user=$_SESSION["user"];
		$curid=$_SESSION["curid"];
		$dbconnection=$_SESSION["dbconnection"];		
	if(session_is_registered("dbconnection") )
	{
	
?>
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
.style11 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #999999; }
.style12 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style14 {font-size: 12px}
.style15 {color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; }
.style16 {color: #000000}
.style6 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.style9 {color: #184584}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style17 {color: #FF0000}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<?php
		if(($user!="") && (($curid!="") || ($curid!=0)))
		{
			$sql="";
?>		
<?php include "allheader.php"  ?>	
<?php	
		//echo $user;
		$sql="select N_POINT from POINT_MASTER where N_ID=$curid ";
		$result=mysql_query($sql);
		$rownum=mysql_num_rows($result);
		if($rownum >0)
		{
			$rownum=$rownum-1;
			$current_point=mysql_result($result,$rownum,"N_POINT");
		
		}

		}

?> 

<?php
if($current_point > 0)
	{
?>
<form name="form1" method="post" action="pointtransfer_check.php">
<br>
<br>
<br>

<table width="502" border="1" align="center" cellpadding="4" cellspacing="4" bordercolor="#666666">
  <tr>
    <td height="33" colspan="4" bgcolor="#F9F9F9" class="style19"><span class="style20"> Point Transfer Details:-</span></td>
  </tr>
  <tr>
    <td height="30" class="style21">Current Balance:</td>
    <td width="327" colspan="2" class="style22"><?phpphp echo $current_point ?></td>
  </tr>
  <tr>
    <td width="141" height="30" class="style21">Transfer Point:</td>
    <td colspan="2" class="style22"><input type="text" name="txtTransferpoint" id="txtTransferpoint">
      <b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font size="1"><font color="#FF0000">*</font></font></b></font></b></td>
  </tr>
  <tr>
    <td height="30" class="style21">Transfer Username:</td>
    <td class="style22"><input type="text" name="txtUsername" id="txtUsername">
      <b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font size="1"><font color="#FF0000">*</font></font></b></font></b></td>
  </tr>
  
  <tr>
    <td height="30" class="style21">Withdrawal Pin:</td>
    <td colspan="2" class="style22"><select name="pin1" id="pin1" style=" BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; COLOR: #000000; BORDER-BOTTOM: 1px solid; ">
      <option value="none">-NA-</option>
      <?php
			 		$acpin1="";
			 		for($i=0; $i<=9;$i++)
			  		{
					if($i>9)
					$acpin1=$i;
					else
					$acpin1=$i;
					if($pin1==$i)  {
			    	?>
      <option value="<?php echo $acpin1 ?>" selected="selected"><strong> <?php echo $acpin1 ?> </strong></option>
      <?php
			  		}
					else
					{
					?>
      <option value="<?php echo $acpin1 ?>"><strong> <?php echo $acpin1 ?> </strong></option>
      <?php
					 }
					 }
			 		?>
    </select>
      <select name="pin2" id="pin2" style=" BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; COLOR: #000000; BORDER-BOTTOM: 1px solid; ">
        <option value="none">-NA-</option>
        <?php
			 		$acpin2="";
			 		for($i=0; $i<=9;$i++)
			  		{
					if($i>9)
					$acpin2=$i;
					else
					$acpin2=$i;
					if($pin2==$i)  {
			    	?>
        <option value="<?php echo $acpin2 ?>" selected="selected"><strong> <?php echo $acpin2 ?> </strong></option>
        <?php
			  		}
					else
					{
					?>
        <option value="<?php echo $acpin2 ?>"><strong> <?php echo $acpin2 ?> </strong></option>
        <?php
					 }
					 }
			 		?>
      </select>
      <select name="pin3" id="pin3" style=" BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; COLOR: #000000; BORDER-BOTTOM: 1px solid; ">
        <option value="none">-NA-</option>
        <?php
			 		$acpin3="";
			 		for($i=0; $i<=9;$i++)
			  		{
					if($i>9)
						$acpin3=$i;
					else
						$acpin3=$i;
					if($pin3==$i)  {
			    	?>
        <option value="<?php echo $acpin3 ?>" selected="selected"><strong> <?php echo $acpin3 ?> </strong></option>
        <?php
			  		}
					else
					{
					?>
        <option value="<?php echo $acpin3 ?>"><strong> <?php echo $acpin3 ?> </strong></option>
        <?php
					 }
					 }
			 		?>
      </select>
      <select name="pin4" id="pin4" style=" BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; COLOR: #000000; BORDER-BOTTOM: 1px solid; ">
        <option value="none">-NA-</option>
        <?php
			 		$acpin4="";
			 		for($i=0; $i<=9;$i++)
			  		{
					if($i>9)
					$acpin4=$i;
					else
					$acpin4=$i;
					if($pin4==$i)  {
			    	?>
        <option value="<?php echo $acpin4 ?>" selected="selected"><strong> <?php echo $acpin4 ?> </strong></option>
        <?php
			  		}
					else
					{
					?>
        <option value="<?php echo $acpin4 ?>"><strong> <?php echo $acpin4 ?> </strong></option>
        <?php
					 }
					 }
			 		?>
      </select>
      <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="style17">*</span></font></td>
  </tr>
  <tr>
    <td height="30" class="style21">&nbsp;</td>
    <td colspan="2" class="style22">&nbsp;</td>
  </tr>
</table>

<br>
<div align="center">
  <input name="Submit2" type="submit"  value="Transfer" >
  <br>
</div>
</form>
<?php
}
else
{
?>
<br>
<br>
<br>
<br>
<br>
<table width="619" border="1" align="center" cellpadding="4" cellspacing="4" bordercolor="#666666">
  <tr>
    <td colspan="4" bgcolor="#F9F9F9" class="style19"><span class="style20"> Point Transfer Details:-</span></td>
  </tr>
  <tr>
    <td width="122" height="30" class="style21">Current Balance:</td>
    <td width="463" colspan="2" class="style22"><?php $current_point ?></td>
  </tr>
  <tr>
    <td colspan="3" class="style21 style23">Error.....</td>
  </tr>
  
  <tr>
    <td height="30" colspan="3" class="style24">Minimum balance is needed for point transfering .Your current balance is less than minimum balance. Now you can't possible to do point transfer . </td>
  </tr>
</table>
<?php
}
?>
<br>

</body>
</html>
<?php
	}
	else
	{
		$errormsg="Your session is expeired. Please login again.";
		header("location: index.php?error=$errormsg");
	}
?>	
